package com.hrserviceserve.service;

import com.hrserviceserve.dao.TransferRepository;
import com.hrserviceserve.entity.Result;
import com.hrserviceserve.entity.Transfer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

@Service
public class TransferService {
    @Autowired
    TransferRepository transferRepository;
    public Result findAll(int page,int limit,Integer id){
        PageRequest pageRequest=PageRequest.of(page-1,limit);
        Page<Transfer> allWhere = transferRepository.findAllWhere(id, pageRequest);
        return Result.success(allWhere);
    }
}
